import request from '@/utils/request'

// api地址
const api = {
    list: '/order/orderList',//订单列表
    expeditingOrder: '/order/expeditingOrder',//催货
    detail:'/order/getOrderInfo',//订单详情
    buy:'/order/orderBuy',//下单
    pay:'/order/orderPaying',//支付
    payResult:'/order/result',//支付结果
    sure:'/order/sureOrder'
}

// 订单列表
export const orderList = (data) => {
    return request.post(api.list, data)
}
// 催货
export const expeditingOrder = (data) => {
    return request.get(api.expeditingOrder, data)
}
// 订单详情
export const getOrderInfo = (data) => {
    return request.get(api.detail, data)
}
// 下单
export const orderBuy = (data) => {
    return request.post(api.buy, data)
}
// 支付
export const orderPaying = (data) => {
    return request.post(api.pay, data)
}
// 支付结果
export const orderResult = (data) => {
    return request.get(api.payResult, data)
}
// 确认收货
export const sureOrder = (data) => {
    return request.post(api.sure, data)
}

export default {
    orderList,
    expeditingOrder,
    getOrderInfo,
    orderBuy,
    orderPaying,
    orderResult,
    sureOrder
}